package com.ruoyi.userManage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.userManage.mapper.DrawRecordMapper;
import com.ruoyi.userManage.domain.DrawRecord;
import com.ruoyi.userManage.service.IDrawRecordService;

/**
 * 抽盒记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-12
 */
@Service
public class DrawRecordServiceImpl implements IDrawRecordService 
{
    @Autowired
    private DrawRecordMapper drawRecordMapper;

    /**
     * 查询抽盒记录
     * 
     * @param id 抽盒记录主键
     * @return 抽盒记录
     */
    @Override
    public DrawRecord selectDrawRecordById(Integer id)
    {
        return drawRecordMapper.selectDrawRecordById(id);
    }

    /**
     * 查询抽盒记录列表
     * 
     * @param drawRecord 抽盒记录
     * @return 抽盒记录
     */
    @Override
    public List<DrawRecord> selectDrawRecordList(DrawRecord drawRecord)
    {
        return drawRecordMapper.selectDrawRecordList(drawRecord);
    }

    /**
     * 新增抽盒记录
     * 
     * @param drawRecord 抽盒记录
     * @return 结果
     */
    @Override
    public int insertDrawRecord(DrawRecord drawRecord)
    {
        drawRecord.setCreateTime(DateUtils.getNowDate());
        return drawRecordMapper.insertDrawRecord(drawRecord);
    }

    /**
     * 修改抽盒记录
     * 
     * @param drawRecord 抽盒记录
     * @return 结果
     */
    @Override
    public int updateDrawRecord(DrawRecord drawRecord)
    {
        drawRecord.setUpdateTime(DateUtils.getNowDate());
        return drawRecordMapper.updateDrawRecord(drawRecord);
    }

    /**
     * 批量删除抽盒记录
     * 
     * @param ids 需要删除的抽盒记录主键
     * @return 结果
     */
    @Override
    public int deleteDrawRecordByIds(Integer[] ids)
    {
        return drawRecordMapper.deleteDrawRecordByIds(ids);
    }

    /**
     * 删除抽盒记录信息
     * 
     * @param id 抽盒记录主键
     * @return 结果
     */
    @Override
    public int deleteDrawRecordById(Integer id)
    {
        return drawRecordMapper.deleteDrawRecordById(id);
    }
}
